<template>
    <div class="home-swipe">
      <van-search v-model="serch" placeholder="请输入搜索关键词" input-align="center" @search="onSearch" />
      <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
        <van-swipe-item v-for="item in bannerDate" :key="item.id">
          <!-- <img :src="item.picUrl" alt=""> -->
          <van-image :src="item.picUrl" lazy-load />
        </van-swipe-item>
      </van-swipe>
    </div>
</template>
<style scoped>
  /* .my-swipe img {
    width: 100%;
    max-width: 1000px;
    border-radius: 20px;
  } */
</style>
<script>
import { Toast } from 'vant';

export default {
  data() {
    return {
      serch: '',
      bannerDate:{}
    };
  },
  created(){
    this.getBanner()
  },
  methods:{
      onSearch(val) {
      Toast(val);
    },
    getBanner(){
      this.$request("get","/recommend/banner")   
      .then(res=>{
        // console.log(res)
        if(res.result == 100){
          console.log()
          this.bannerDate = res.data;
        }
      })
    }
  }
};
</script>

